<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:c="http://java.sun.com/jsp/jstl/core">
<f:view>
	<h:head>
		<title>#{messages.appTitle}</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<h:outputStylesheet name="css/style.css" />
		<link rel="shortcut icon" type="image/x-icon" href="#{request.contextPath}/resources/images/favicon.ico"/>
	</h:head>
	<h:body>
		<div id="header">
			<div class="header_content">
				<h:graphicImage value="/resources/images/logo.gif"
					height="60" width="57"/>			
			</div>
		</div>
		<div id="sub_header">
			<div class="sub_header_content">
				<span>#{messages.appName}</span>
				<div class="sub_header_content_user">
					<h:panelGrid columns="2">
						<h:outputFormat value="#{messages.wellcomeUser}">
							<f:param value="#{homeBean.loggedUsername}" />
						</h:outputFormat>
						<a href="#{facesContext.externalContext.requestContextPath}/logout">#{messages.logout}</a>
					</h:panelGrid>
				</div>
			</div>
		</div>
		<div id="content">
			<div class="ruta">
				<ui:insert name="breadcrumb"/>
			</div>
			
			<div class="menu">
				<h:form>
					<ul>		
				<ui:repeat var="menu" value="#{homeBean.userMenues}">
						<li>
					<c:choose>
						<c:when test="#{menu.selected}">
							<h:commandLink styleClass="menuSelected" action="#{menuBean.processMenu}" value="#{messages[menu.menuName]}">
								<f:setPropertyActionListener value="#{menu}" target="#{menuBean.menu}" />
							</h:commandLink>
						</c:when>
						<c:otherwise>
							<h:commandLink styleClass="menuNotSelected" action="#{menuBean.processMenu}" value="#{messages[menu.menuName]}">
								<f:setPropertyActionListener value="#{menu}" target="#{menuBean.menu}" />
							</h:commandLink>
						</c:otherwise>
					</c:choose>
						</li>
				</ui:repeat>
					</ul>			
				</h:form>  
			</div>
			
			<div class="content_right">
				<p class="titol_content"><ui:insert name="title" /></p>
				<br />
				<!-- Idiomes 
				<ui:insert name="idiomes">
					<ui:include src="idiomes.xhtml" />
				</ui:insert>
				-->
				
				<div class="clearer"></div>
				
				<ui:insert name="content" />
			</div>
		</div>
		
		<div class="clearer"></div>
	
		<div id="footer">
			<div class="footer_content">
				<div class="footer_content_left">
				<p class="footer_titol">#{messages.footerText}</p>
				</div>	
				<div class="footer_content_center">
				<p class="footer">#{messages.footerCenter}</p>
				</div>	
				<div class="footer_content_right">
				<p class="footer">
					<h:link styleClass="neta" outcome="/legal.xhtml" value="#{messages.footerLegal}"/> | <h:link styleClass="neta" outcome="/contacto.xhtml" value="#{messages.footerContacto}"/></p>
				</div>			
			</div>
		</div>
	</h:body>
</f:view>
</html>
